package com.mvc.web.user.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.mvc.web.common.ibatis.IbatisDaoImpl;
import com.mvc.web.main.vo.SerachConditionVo;
import com.mvc.web.user.dao.UserDao;
import com.mvc.web.user.vo.UserVo;

@Repository
public class UserDaoImpl extends IbatisDaoImpl implements UserDao{

	@Override
	public int doRegist(UserVo vo) {
		Integer id = this.insertBackId("user.regist", vo);
		return id;
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<UserVo> getList(SerachConditionVo vo) {
		return (List<UserVo>) this.queryForList("user.getList", vo);
	}

	@Override
	public long getCount(SerachConditionVo vo) {
		return (long) this.queryForObject("user.getCount", vo);
	}

	@Override
	public UserVo getUserById(Integer uid) {
		return (UserVo) this.queryForObject("user.getUserById", uid);
	}

}
